﻿namespace question4
{
    public class Circle
    {
        private double r;
        public Circle(double r)
        {
            this.r = r;
        }
        public double zhouc()
        {
            return 2 * Math.PI * r;
        }
        public double Area()
        {
            return Math.PI * r * r;
        }

        public double R
        {
            get { return r; }
            set
            {
                if (value > 0)
                    r = value;
            }
        }
        public void Display()
        {
            Console.WriteLine($"圆的半径: {r:F2}");
            Console.WriteLine($"圆的周长: {zhouc():F2}");
            Console.WriteLine($"圆的面积: {Area():F2}\n");
        }
    }

    public class Program
    {
        public static void Main()
        {
            Circle circle1 = new Circle(5);
            Circle circle2 = new Circle(3.5);
            Console.WriteLine("第一个圆的信息:");
            circle1.Display();
        }
    }

}
